/******************************************************************************
**                                                                           **
**                 Proprietary and Confidential Information                  **
**                                                                           **
**                 Copyright (c) Conexant Systems, Inc. Unpublished                  **
**                                                                           **
** This source code and the algorithms implemented therein constitute        **
** confidential information and may compromise trade secrets of Conexant Systems,    **
** Inc. or its associates, and any unauthorized use thereof is prohibited.   **
**                                                                           **
******************************************************************************/

#ifndef __DC_CSC_API_H__
#define __DC_CSC_API_H__

/******************************************************************************
*  FILE FORMAT:
*      1. INCLUDES 
*      2. ENUMERATIONS 
*      3. DEFINES
*      4. STRUCTURES
*      5. GLOBALS
*      6. PRIVATE FUNCTION PROTOTYPES
*      7. FUNCTIONS
******************************************************************************/

/******************************************************************************
*  1. INCLUDES
******************************************************************************/
#ifdef LINUX
#include "ospl.h"
#else
#include "tx_api.h"
#endif

#include "dc_type.h"

#include "dc_conip_api.h"
#include "dc_conip_extended_api.h"

/******************************************************************************
*  2. ENUMERATIONS
******************************************************************************/

typedef enum {
  DC_CSC_OPTIONS_NONE =0,
  DC_CSC_OPTIONS_ONCHIP, 
  DC_CSC_OPTIONS_ONCHIP_SPEED,
  DC_CSC_OPTIONS_HYBRID
} DC_CSC_OPTIONS;

/******************************************************************************
*  3. DEFINES
******************************************************************************/

#define DC_MAX_ONCHIP_TABLE_COUNT   4
#define DC_MAX_OFFCHIP_TABLE_COUNT  4

/******************************************************************************
*  4. STRUCTURES
******************************************************************************/


/******************************************************************************
*  5. GLOBALS
******************************************************************************/


/******************************************************************************
*  6. PRIVATE FUNCTION PROTOTYPES
******************************************************************************/
DC_RETURN_CODE dc_csc_setup(int max_nComponents,
                           int max_onchip_LUT_size,
                           int max_offchip_LUT_size,
                           int onchip_table_count,
                           int offchip_table_count,
                           int cascaded,
                           DC_MEM_PARAMS_t *pMemParams);

DC_RETURN_CODE dc_csc_init(DC_MEM_PARAMS_t *pMemParams);
DC_RETURN_CODE dc_csc_close(void);

DC_RETURN_CODE dc_csc_resource_info_get(char *resoucce_name,
                                     UINT32 *lut_size,
                                     UINT32 *n_components);

DC_RETURN_CODE dc_csc_alloc_and_load(DC_CONIP_CSC_TABLE_DATA *,
                                     char *resoucce_name,
                                     DC_CSC_OPTIONS options);

DC_RETURN_CODE dc_csc_alloc_and_load_extend(DC_CONIP_CSC_TABLE_DATA *,
                                     char *resoucce_name,
                                     char *second_resource_name,
                                     DC_CSC_OPTIONS options,
                                     UINT8 options_arg0,
                                     UINT8 options_arg1,
                                     UINT8 options_arg2);

DC_RETURN_CODE dc_csc_alloc_and_load_extend_wTRC(DC_CONIP_CSC_TABLE_DATA *cscTable,
                                     char *resource_name,
                                     char *second_resource_name,
                                     DC_CSC_OPTIONS options,
                                     UINT8 *trcTables[6],   //[6][256]
                                     UINT32 out_lut_size,
                                     UINT8 options_arg0,
                                     UINT8 options_arg1,
                                     UINT8 options_arg2);

DC_RETURN_CODE dc_csc_free(DC_CONIP_CSC_TABLE_DATA *);

DC_RETURN_CODE dc_csc_resource_onchip_convert (char *resource_name,
                                       UINT8 *onchip_memory_address,
                                       UINT32 onchip_memory_size,
                                       UINT32 *lut_size,
                                       UINT32 *n_components);
#endif
